<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="common/header.jsp" %>
<div id="main" class="wrap">
<%@ include file="common/left.jsp" %>
	<div class="main">
		<h2>修改商品</h2>
		<div class="manage">
			<form action="${ctx}/ProductmServlet" method="post">
			<input type="hidden" name="op" value="updatepro"/>
			<input type="hidden" name="pid" value="${pro.pid}"/>
				<table class="form">
					<tr>
						<td class="field">商品名称(*)：</td>
						<td><input type="text" class="text" name="pname" value="${pro.pname}" /></td>
					</tr>
                    <tr>
						<td class="field">描述：</td>
						<td><input type="text" class="text" name="description" value="${pro.description}"/></td>
					</tr>
					<tr>
						<td class="field">所属分类：</td>
						<td>
							<select name="p_spid">
								<c:forEach items="${proCate}" var="p">
								<option value="${p.bpid}">${p.type}</option>
								
									<c:forEach items="${p.listProductSmallCategory}" var="ls">
									<c:if test="${ls.spid==pro.p_spid}">
									<option value="${ls.spid}" selected="selected">${ls.spname}</option>
									</c:if>
									<c:if test="${ls.spid!=pro.p_spid}">
									<option value="${ls.spid}">${ls.spname}</option>
									</c:if>
									</c:forEach>
				
								</c:forEach>
							</select>
						</td>
					</tr>					
					<tr>
						<td class="field">商品价格(*)：</td>
						<td><input type="text" class="text tiny" name="price" value="${pro.price}" /> 元</td>
					</tr>
					
					<tr>
						<td class="field">库存(*)：</td>
						<td><input type="text" class="text tiny" name="pnum" value="${pro.pnum}" /></td>
					</tr>
					<tr>
						<td class="field">商品图片：</td>
						<td><input type="file" class="text" name="imgurl" /></td>
					</tr>
					<tr>
						<td></td>
						<td><label class="ui-blue"><input type="submit" name="submit" value="确定" /></label></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<div class="clear"></div>
</div>
<%@ include file="common/foot.jsp"%>